package Day.Learn;

class Fast extends Thread{
    //重写run方法
    public void run(){
        for(int i=0;i<20;i++){
            System.out.println("快线程"+i);
            try{
                Thread.sleep(1000);
            }
            catch (InterruptedException e){}
        }
    }
}
class Slow implements Runnable{
    public void run(){
        for(int j=0;j<20;j++){
            System.out.println("慢线程======"+j);
            try{
                Thread.sleep(2000);
            }catch (InterruptedException e){}
        }
    }
}
public class Test1_1 {
    public static void main(String[] args) {
        Fast f=new Fast();
        f.start();
        Slow s=new Slow();
        Thread thread=new Thread(s);
        thread.start();
    }
}
